package org.codefinger.dao.callback;

import java.math.BigDecimal;
import java.sql.ResultSet;

import org.codefinger.dao.impl.ResultSetCallback;

public class BigDecimalQueryCallback implements ResultSetCallback<BigDecimal> {

	public static final BigDecimalQueryCallback	INSTANCE	= new BigDecimalQueryCallback();

	private BigDecimalQueryCallback() {

	}

	@Override
	public BigDecimal getResult(ResultSet resultSet, String[] aliases) throws Throwable {
		if (resultSet.next()) {
			return resultSet.getBigDecimal(1);
		}
		return null;
	}

}
